package top.raoqq.sky.util;


import top.raoqq.sky.constant.HttpConstant;
import top.raoqq.sky.constant.SkyConstant;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 饶奇奇
 * @date 2023/8/8
 */
public class ServletUtils {

    public static void writeJson(HttpServletResponse response, String data) throws IOException {
        response.setCharacterEncoding(SkyConstant.UTF8);
        response.setContentType(HttpConstant.JSON_MIME_TYPE);
        response.getWriter().println(data);
    }
}
